package com.ambow.core.service.impl;

import com.ambow.core.po.DqGame;
import com.ambow.core.po.DqWarehouse;
import com.ambow.core.mapper.DqWarehouseMapper;
import com.ambow.core.service.DqWarehouseService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * warehouse库表 服务实现类
 * </p>
 *
 * @author dq
 * @since 2022-09-05
 */
@Service
public class DqWarehouseServiceImpl extends ServiceImpl<DqWarehouseMapper, DqWarehouse> implements DqWarehouseService {

    @Autowired
    private DqWarehouseMapper dqWarehouseMapper;
    //根据角色id找游戏id存储在库里
    @Override
    public List<DqWarehouse> findGameListByRoleId(Integer roleId) {
        QueryWrapper<DqWarehouse> wrapper = new QueryWrapper<>();
        wrapper.eq("role_id",roleId);
        List<DqWarehouse> dqWarehouses = dqWarehouseMapper.selectList(wrapper);
        return dqWarehouses;
    }
}
